package org.jsola.hr.web;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.jsola.admin.query.HeaderFieldsQuery;
import org.jsola.admin.vo.HeaderFieldsVO;
import org.jsola.core.Page;
import org.jsola.core.Result;
import org.jsola.hr.dto.FormGroupAddDTO;
import org.jsola.hr.dto.FormGroupBatchDTO;
import org.jsola.hr.dto.FormGroupUpdateDTO;
import org.jsola.hr.query.FormGroupQuery;
import org.jsola.hr.query.FormQuery;
import org.jsola.hr.vo.FormGroupListVO;
import org.jsola.hr.vo.FormGroupVO;
import org.jsola.hr.vo.FormHeaderVO;
import org.jsola.hr.vo.FormVO;

import java.util.List;

/**
 * 表单字段分组
 *
 * @author zhr
 */
@Api(tags = "hr-表单字段分组")
public interface IFormGroupControllerAPI {

    /**
     * 新增表单字段分组
     * @param formGroupAddDTO 表单字段分组新增实体
     * @return 表单字段分组展示对象
     */
    @ApiOperation(value = "新增表单字段分组")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "formGroupAddDTO", dataType = "FormGroupAddDTO", value = "新增表单字段分组", paramType = "body")
    })
    Result<FormGroupVO> save(FormGroupAddDTO formGroupAddDTO);


    /**
     * 修改表单字段分组
     * @param formGroupUpdateDTO 表单字段分组
     * @return 更新数量
     */
    @ApiOperation(value = "修改表单字段分组")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "formGroupUpdateDTO", dataType = "FormGroupUpdateDTO", value = "修改表单字段分组", paramType = "body")
    })
    Result<Integer> update(FormGroupUpdateDTO formGroupUpdateDTO);

    /**
     * 批量编辑、新增、删除表单字段分组
     * @param formGroupBatchDTO 要操作的表单字段分组
     * @return 操作之后的全部表单字段分组
     */
    @ApiOperation(value = "批量编辑、新增、删除表单字段分组")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "formGroupBatchDTO", dataType = "FormGroupBatchDTO", value = "要操作的字段数据", paramType = "body")
    })
    Result batch(FormGroupBatchDTO formGroupBatchDTO);



    /**
     * 删除单个表单字段分组，彻底删除
     *
     * @param formGroupId 表单字段分组id
     * @param check       是否做校验
     * @return 删除数量
     */
    @ApiOperation(value="删除单个表单字段分组，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "formGroupId", dataType = "Long", value = "表单字段分组id", paramType = "path"),
            @ApiImplicitParam(name = "check", dataType = "Boolean", value = "是否做校验", paramType = "query")
    })
    Result<Integer> delete(Long formGroupId, Boolean check);


    /**
     * 批量删除表单字段分组，彻底删除
     * @param formGroupIds 表单字段分组id集合
     * @return 删除数量
     */
    @ApiOperation(value = "批量删除表单字段分组，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "formGroupIds", dataType = "Long[]", value = "表单字段分组id数组", paramType = "body" ,allowMultiple = true)
    })
    Result<Integer> deleteBatch(Long[] formGroupIds);


    /**
     * 根据表单字段分组id查询表单字段分组详情
     * @param formGroupId 表单字段分组id
     * @return 表单字段分组详情
     */
    @ApiOperation(value="根据表单字段分组id查询表单字段分组详情")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "formGroupId", dataType = "Long", value = "表单字段分组id", paramType = "path")
    })
    Result<FormGroupVO> findById(Long formGroupId);


    /**
     * 查询表单字段分组
     * @param formGroupQuery 表单字段分组查询参数
     * @return page
     */
    @ApiOperation(value="查询表单字段分组")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "formGroupQuery", dataType = "FormGroupQuery", value = "表单字段分组查询参数", paramType = "query")
    })
    Result<List<FormGroupListVO>> listAll(FormGroupQuery formGroupQuery);


     /**
     * 分页查询表单字段分组
     * @param formGroupQuery 表单字段分组查询参数
     * @return page
     */
    @ApiOperation(value="分页查询表单字段分组")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "formGroupQuery", dataType = "FormGroupQuery", value = "表单字段分组查询参数", paramType = "query")
    })
    Result<Page<FormGroupListVO>> page(FormGroupQuery formGroupQuery);

    /**
     * 根据表单字段分组id查询表单字段分组详情
     * @return 表单字段分组详情
     */
    @ApiOperation(value="查询当前租户的供应商模板")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "formType", dataType = "String", value = "表单类型", paramType = "path")
    })
    Result<List<FormGroupVO>> findForm(String formType, String siteId);

    /**
     * 查询表头字段
     *
     * @param headerFieldsQuery 查询
     * @return List
     */
    @ApiOperation(value = "查询表头字段")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "headerFieldsQuery", dataType = "HeaderFieldsQuery", value = "自定义表格列的显示和隐藏查询参数", paramType = "query")
    })
    Result<FormHeaderVO> getHead(HeaderFieldsQuery headerFieldsQuery);
}

